Expand type annotations and add classes for path item handling#412
Open
pappnu wants to merge 12 commits intoloonghao:mainfrom
Open
Expand type annotations and add classes for path item handling#412pappnu wants to merge 12 commits intoloonghao:mainfrom
pappnu wants to merge 12 commits intoloonghao:mainfrom
Conversation
…add various missing properties BREAKING CHANGE: Uses syntax that requires Python 3.10, removes echo, compareWithNumbers and system functions, which simply wrapped basic Python constructs without adding any extra functionality, and makes getByName return None instead of throwing when no match is found.
| | PhotoshopSaveOptions | ||
| | TargaSaveOptions | ||
| | TiffSaveOptions | ||
| | None = None, |
| | PNGSaveOptions | ||
| | PhotoshopSaveOptions | ||
| | TargaSaveOptions | ||
| | TiffSaveOptions |
| | PDFSaveOptions | ||
| | PNGSaveOptions | ||
| | PhotoshopSaveOptions | ||
| | TargaSaveOptions |
| | JPEGSaveOptions | ||
| | PDFSaveOptions | ||
| | PNGSaveOptions | ||
| | PhotoshopSaveOptions |
| | GIFSaveOptions | ||
| | JPEGSaveOptions | ||
| | PDFSaveOptions | ||
| | PNGSaveOptions |
| | EPSSaveOptions | ||
| | GIFSaveOptions | ||
| | JPEGSaveOptions | ||
| | PDFSaveOptions |
| options: BMPSaveOptions | ||
| | EPSSaveOptions | ||
| | GIFSaveOptions | ||
| | JPEGSaveOptions |
| file_path: str, | ||
| options: BMPSaveOptions | ||
| | EPSSaveOptions | ||
| | GIFSaveOptions |
| self, | ||
| file_path: str, | ||
| options: BMPSaveOptions | ||
| | EPSSaveOptions |
…ugh they are converted to integers
| def get(self, key: str) -> TextFont | None: | ||
| ... | ||
|
|
||
| def get(self, key: str, default: T | None = None) -> TextFont | T | None: |
There was a problem hiding this comment.
redefinition of unused 'get' from line 81
| ... | ||
|
|
||
| @overload | ||
| def get(self, key: str) -> TextFont | None: |
There was a problem hiding this comment.
redefinition of unused 'get' from line 77
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR adds extensive type annotations, various missing properties, classes for interacting with path items and tries to lessen some of the repetition within the code. The type annotations don't cover everything, especially things that would have required creating new wrapper classes. The annotations are mostly based on Photoshop Scripting Reference and Photoshop JavaScript Scripting Reference 2020.
Breaking Changes
pyproject.toml.Application.compareWithNumbers,Application.systemandSession.echofunctions as they simply wrapped basic Python actions without adding any extra functionality to them, so I assumed they aren't really necessary.getByNamenow returnsNoneinstead of throwing, as I find that easier to work with in a strictly typed codebase.Testing
I added some tests of my own and ran some of the existing tests, though many of them didn't pass even when using the version from main branch. I also used this a bit with Proxyshop, which uses especially the basic layer modification and action manager parts of the API. There's still many untested properties and functions, so bugs are quite likely.
This might also help with #405.
Please let me know what further changes would be required to get this merged.